Repository navigation
fix(page): leave touch emulation alone on resize unless mobile is set - #352
Merged
Merged
Conversation
Options#mobile defaults to nil, so resizing a window no longer turns touch emulation off, which reset hover and pointer overrides passed with --blink-settings. Requires Ferrum 0.20.1. Refs #282, rubycdp/ferrum#664
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #282, rubycdp/ferrum#664.
Cuprite resizes the page whenever it attaches one and on
resize_to, maximize and fullscreen. Ferrum'sset_viewportused to sendEmulation.setTouchEmulationEnabled(enabled: false)for every desktop viewport, and Chrome answers that by resetting hover and pointer to the detected input devices. That undid overrides passed with--blink-settings(e.g.primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4, the workaround from #282), so on headless Linux@media (hover: hover)stopped matching after a resize.Ferrum 0.20.1 leaves touch emulation alone when
set_viewportgetsmobile: nil. This makesOptions#mobiledefault tonilinstead offalseand requiresferrum ~> 0.20.1.mobile: trueand theemulate:devices still turn touch emulation on.The new feature spec launches Chrome with a coarse pointer through
--blink-settingsand checks it survivescurrent_window.resize_to; it fails with the oldfalsedefault.